﻿using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;
namespace JQMergeFramework
{
    //城堡基类
    public class UnitBase : MonoBehaviour
    {
        public MeshRenderer mMeshRenderer;

        public MeshFilter mMeshFilter;
        
        //绑定的传送带父物体
        public TrackUnit mTrackUnit;
        
        
        //音效控制器
        public AudioSourceCtrl audioCtr;
        
        public UnitDataBase mUnitData;

        public UnitDataBase UnitData
        {
            get { return mUnitData; }
        }

        public Vector3  mMeshSize;
        //放置时的坐标
        protected Vector3 mDefaultPos;

        public Vector3 DefaultPos
        {
            get { return mDefaultPos; }
        }
        
        protected Transform mTransform;
        
        public int Level
        {
            get { return mUnitData.UnitLevel; }
        }

        //绑定的平台信息
        public GroundBase mGroundBase;
        

        public Vector3 offset = new Vector3(0,1,0);
        
        private void Awake()
        {
            mTransform = this.transform;
        }
        
        protected virtual void Start()
        {
         
        }


        //设置为半透明状态
        public virtual void SetTransparencyMat()
        {
        }

        //设置为默认状态
        public virtual void SetDefaultMat()
        {
        }

        //移动到指定位置
        public virtual void Move(Vector3 targetPos,float t = 0.2f)
        {
        }

        //移动到默认放置的位置
        public virtual void MoveDefaultPlacePos()
        {
        }
        
        public virtual void RefreshLevel()
        {
            // text.text = unitData.UnitLevel.ToString();
        }
        
    }
}

